SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = object_id('dbo.lib_find_return'))
	DROP PROCEDURE dbo.lib_find_return
GO

CREATE PROCEDURE dbo.lib_find_return
	@book_no nvarchar(20)

AS
BEGIN
	SET NOCOUNT ON;
	
	SELECT top 1 * FROM borrow Where book_no = @book_no and return_date >getdate() order by return_date;

END